<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<script type="text/javascript">
	function showMsg($item, msgType, msg, timeout){
		var classType='ui-state-highlight';
		if(msgType=='error'){
			classType='ui-state-error';
		}
		$item.addClass(classType);
		$item.html("<span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span>"+msg);
		setTimeout(function(){$item.html('').removeClass(classType);},timeout);
	}
	function query(){
		var key=jQuery.trim($('#key').val());
		if(key.length==0){
			showMsg($('#searchTips'),'error','请输入电话搜索关键字，例如：中国移动',5000);
			return;
		}
		window.location.href="<c:url value='/search?'/>key="+encodeURIComponent(key);
	}
	function enterKey(){
		if(event.keyCode==13){query();}
	}
	$(function(){
		$('#key').focus();
		$('#go').click(function(){query();});
	});
</script>
<table>
	<tr>
		<td>
		<div id="search_small"><input id="key" name="key"
			onkeydown="enterKey();" value="${param.key}" />
		<button id="go" value="搜索电话">搜索电话</button>
		<div id="searchTips"></div>
		</div>
		<div id="left" class="top-border">
		<p class="title">搜索结果</p>
		<c:if test="${empty it}">没有查找到满足条件的电话</c:if> <c:forEach var="e"
			items="${it}">
			<div class="nodeData">
			<div class="nodeData_title">${e.name}&nbsp;<a href="#"
				title="分享给好友" flowId="${e.id}"
				class="ui-icon ui-icon-signal-diag flow-share">分享给好友</a>&nbsp;<a
				href="#" title="加入我的电话" flowId="${e.id}"
				class="ui-icon ui-icon-check flow-add">加入我的电话</a>&nbsp;</div>
			<div class="nodeData_content">${e.content}</div>
			<div class="nodeData_bottom"><font><c:choose>
				<c:when test="${not empty e.owner}">${e.owner}</c:when>
				<c:otherwise>anonymous</c:otherwise>
			</c:choose></font><fmt:formatDate value="${e.crtDate}" pattern="MM-dd HH:mm:ss" />&nbsp;&nbsp;</div>
			</div>
		</c:forEach></div>
		</td>
		<td>
		<div id="right"></div>
		</td>
	</tr>
</table>
